Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
Show the code
library(leaflet)library(terra)
terra 1.8.15
Show the code
# Load spatial EJ dataej_data_sp <-read_sf('data/ej_cases/ej_data_public.gpkg')# Load biodiversity databiodiv <-rast('data/important_biodiversity_areas/minshort_speciestargetswithPA_esh10km_repruns10_ranked.tif')# Define robin projectionrobin <-"+proj=robin +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"# Transform to Robinson projectionej_data_sp_robin <- sf::st_transform(ej_data_sp, crs = robin)biodiv_robin <-project(biodiv, robin)# Create a leaflet mapleaflet() |>addTiles() |>addRasterImage(biodiv_robin) |>addMarkers(data = ej_data_sp_robin)
Warning: sf layer is not long-lat data
Warning: Point outside of projection domain (GDAL error 1)
Warning: Point outside of projection domain (GDAL error 1)
Warning: Point outside of projection domain (GDAL error 1)
Warning: Point outside of projection domain (GDAL error 1)